package com.base.day8;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class JDBCComon {
	
	public Connection getConnection() throws ClassNotFoundException, SQLException{
		
		Class.forName("com.mysql.cj.jdbc.Driver");
		//java10是数据库的名字
		String url="jdbc:mysql://localhost:3306/java10?useSSL=false&serverTimezone=Asia/Shanghai";
		//登录数据库用户名
		String username="root";
		//登录数据库密码
		String pwd="Java20190713*yy";
		Connection conn = DriverManager.getConnection(url,username,pwd);
		return conn;
		
	}

}
